package br.com.paiva.container.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import br.com.paiva.container.Moeda;
import br.com.paiva.container.dao.MoedaDAO;
import br.com.paiva.container.service.MoedaService;

@Service("moedaService")
public class MoedaServiceImpl implements MoedaService {
	
	@Autowired
	private MoedaDAO moedaDAO;
	
	public void setMoedaDAO(MoedaDAO moedaDAO) {
		this.moedaDAO = moedaDAO;
	}

	@Transactional(propagation=Propagation.REQUIRED)
	public void save(Moeda aeroporto) {
		this.moedaDAO.save(aeroporto);
	}
	
	public List<Moeda> list() {
		return this.moedaDAO.list();
	}
	
	public Moeda getMoedaById(Long id) {
		return this.moedaDAO.retrive(id);
	}
	
	public void delete(Long id) {
		// TODO Auto-generated method stub
		
	}

	public List<String> searchMoeda(String nome) {
		return this.moedaDAO.searchMoeda(nome);
	}
	
}
